import { Pagination as AntDPagination, PaginationProps } from 'antd';
import { CommonComponentProps } from '@/pages/lowCodeEditorPlus/interface';
import { useSetMaterialStylesheet } from '@/pages/lowCodeEditorPlus/hooks/useSetMaterialStylesheet';
import { useContext, useEffect } from 'react';
// import { TableContext } from '@/pages/lowCodeEditorPlus/contextProvider/TableProvider';

const Pagination = (props: CommonComponentProps) => {
  const {id, name, customClassStyle, pageSize, ...restProps} = props
  // const {total} = useContext(TableContext)
  const total = 10
  
  useSetMaterialStylesheet(id);
  return (
    // <div data-component-id={id}>
      <AntDPagination data-component-id={id}
      defaultCurrent={1}
      total={total}
      showTotal={(total) => `共 ${total} 条`}
      showQuickJumper
      pageSize={pageSize} {...restProps}/>      
    // </div>
  )
}

export default Pagination;